package cn.lds.j375.healthexam.controller;

import cn.lds.j375.healthexam.entity.HealthExamPackage;
import cn.lds.j375.healthexam.dto.ResultDTO;
import cn.lds.j375.healthexam.service.HealthExamPackageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

@Controller
public class HomeController {

    @Autowired
    private HealthExamPackageService healthExamPackageService;

    @GetMapping("/")
    public String home(Model model){

        ResultDTO<List<HealthExamPackage>> listResultDTO = healthExamPackageService.selectHealthExamPackageAll();

        model.addAttribute("result",listResultDTO);


        return "index";
    }

    @GetMapping("/go_403")
    public String go403(){
        return "403";
    }
}
